package io.renren.modules.backstage.feign;
import com.tencent.search.pojo.CourseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "search")
public interface CourseFeignClients {

    @RequestMapping("/elastic/searchFromEs")
    List<CourseEntity> searchFromEs(@RequestBody Map<String, Object> params);

    @RequestMapping("/elastic/getById")
    CourseEntity getById(@RequestParam("id") Long id);

    @RequestMapping("/elastic/save")
    void save(@RequestBody CourseEntity course);

    @RequestMapping("/elastic/updateById")
    void updateById(@RequestBody CourseEntity courseEntity);

    @RequestMapping("/elastic/delete")
    void delete(@RequestBody Long[] ids);

    @RequestMapping("/elastic/saveAll")
    void saveAll(@RequestBody List<CourseEntity> list);

    @RequestMapping("/elastic/searchCourse")
    Map<String,Object> searchCourse(@RequestParam Map<String, Object> paramMap);

}
